package com.ys.web.controller;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ys.WebConstants;
import com.ys.extend.ImportStateRecord;
import com.ys.extend.utils.ContextHolderUtils;

/**
 * 读取导入数数据库的状态
 * @author wdj
 *
 */
@Scope("prototype")
@Controller
@RequestMapping("/importStateController")
public class ImportStateController {

	
	/**
	 * 读取导入数数据库状态的信息
	 * @param accountId
	 * @return
	 */
	@ResponseBody
	@RequestMapping(params="getImportStateMsg")
	public String getImportStateMsg() {		
		/**会话的username*/
		String username = (String) ContextHolderUtils.getSession().getAttribute("username");	
		String message = ImportStateRecord.getStateMsg(username);
		System.out.println(message);
		if(null==message) {			
			message=WebConstants.FAIL_CODE;
		}
		
		return message;
	}

	
	
		
}
